﻿using fuzhu;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XXX.Common;
using XXX.Models;

namespace XXX.Bo
{
    public class WDFTQueryService
    {
        /// <summary>
        /// 读取币种汇率
        /// </summary>
        /// <param name="iyear">年度</param>
        /// <param name="imonth">月份</param>
        /// <param name="cexchname">币种</param>
        /// <returns></returns>
        public static RetModel2 AA_GetExchFlat(string iyear, string imonth, string cexchname)
        {
            try
            { 
                string sqlwh = string.Format(@"select nflat from exch where iYear ='{0}'  and  iperiod ='{1}' and cexch_name='{2}' and Itype=2 ", iyear, imonth, cexchname);

                object nflat = DbHelper2.ExecuteScalar(sqlwh, CanShu.conStr);
                if (nflat == null)
                {
                    return DBService.ReErrObject("没有定义此汇率");
                }
                else
                {
                    return DBService.ReOKObject(nflat);
                }
            }
            catch (Exception ex)
            {
                return DBService.ReErrObject(ex.Message);
            }

        }
    }
    

}
